//var preUrl = "http://192.168.1.13:8081/zzapp";
var preUrl = "http://47.92.153.57:8080/zzapp";

function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
    var expires = "expires=" + d.toUTCString();
    document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/" //这个很重要代表在那个层级下可以访问cookie
    console.log(d)
}



//获取cookie
function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1);
        if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
    }
    return "";
}

function returnStr() {

}
//删除 cookie
function clearCookie(name) {
    setCookie(name, "", -1);
}

function getSession(key) {
    var ss = window.sessionStorage;
    let value = ss.getItem(key);
    return JSON.parse(value);
}

function setSession(key, value) {
    var ss = window.sessionStorage;
    ss.setItem(key, value);

}


// 快递公司
var zExpressKey = {
    "expressname": "快递公司名称",
    "adminId": "用户id",
    "time": "时间",
    "id": "id",
};


//管理员
var adminKey = {
    "name": "名称",
    "phone": "手机",
    "time": "时间",
    logintime: "最后登陆时间",
    password: "密码",
    regdate: "注册时间",
    userStatus: "",
    status: "状态",
    sysname: "管理员名字",
    phone: "管理员手机",
    password: "管理员密码",


};
//代理申请
var replaceKey = {
    agentGood: "曼瑜童颜喷雾",
    applyTime: "申请时间",
    goodid: "goodid",
    id: "id",
    money: "金额",
    name: "名称",
    num: "num",
    phone: "手机",
    photo: "照片",
    status: "status",
    superCodes: "superCodes",
    superName: "最高管理员",
    userid: "userid",
    voucher: "voucher"
};

//待发货订单
var unCheckKey = {
    "orderId": "订单id",
    "userId": "用户id",
    "goodsId": "商品id",
    "rewardId": "奖励id",
    "ordernum": "订单编号",
    "money": "金额",
    "number": "数量",
    "imgs": "图片地址",
    "address": "地址",
    "name": "名称",
    "iphone": "电话",
    "waybill": "付款方式",
    "nowtime": "时间",
    "superReward": "奖金",
    "phone": "电话",
    "goodsname": "商品名",
    "waybillname": "账单名",
    "supercodes": "supercodes",
    "status": "权限",
    "orderStatus": "订单状态",
    "superperson": "超级管理员",
    "superpersonid": "超级管理员id",
    "superphone": "超级管理员电话",
    "photo": "照片",
    "voucher": "凭证",
    "orstatus": "orstatus",
    "rebate": null
}
//已发货

var allOrderKey = {
    "orderId": "订单id",
    "userId": "用户id",
    "goodsId": "商品id",
    "rewardId": "奖励id",
    "ordernum": "订单编号",
    "money": "金额",
    "number": "数量",
    "imgs": "图片地址",
    "address": "地址",
    "name": "名称",
    "iphone": "电话",
    "waybill": "付款方式",
    "nowtime": "时间",
    "superReward": "奖金",
    "phone": "电话",
    "goodsname": "商品名",
    "waybillname": "账单名",
    "supercodes": "supercodes",
    "status": "权限",
    "orderStatus": "订单状态",
    "superperson": "超级管理员",
    "superpersonid": "超级管理员id",
    "superphone": "超级管理员电话",
    "photo": "照片",
    "voucher": "凭证",
    "orstatus": "orstatus",
    "rebate": null
}
//商品分类
var goodsKey = {
    "createDate": "创建日期",
    "lastModify": "lastModify",
    "catName": "名称",
    "adminId": "用户id",
    "time": "时间",
    "catId": "id",
};
//商品
var goodKey = {

    "goodName": "商品名",
    "goodcat": "商品分类",
    "goodPrice": "商品价格",
    "groupPurchase": "团购",
    "silverDrill": "银钻",
    "goldDrill": "金钻",
    "generalGeneration": "总代",
    "goodIntro": "商品介绍",
    "goodSaleState": "出售状态",
    "goodImageDefault": "商品默认图",
    "goodImage": "商品图",
    "miaoshu": "商品描述",
    "syff": "使用方法",
    "chengfen": "商品成分",
    "goodSalesVolume": "商品销量",
    "createDate": "创建时间",
    "lastModify": "最后更新时间",
    lastModify: "最后更新时间",
    recommendMoney: "推荐金额",
    superioragentAward: "申请代理的上级服务人奖励",
    fuwu: "服务人奖励",
    superfuwu: "上级服务人奖励",

    "Price": "单价",
    "img": "商品图片",
    "goodName": "商品名称",
    "adminid": "后台管理员id",
    "zd": "总代价格",
    "jz": "金钻价格",
    "cat": "商品分类",
    "yz": "银钻价格",
    "tg": "团购价格",
    "miaoshu": "描述",
    "chengfen": "成分",
    "syff": "使用方法",
    "dailiimage": "代理详情图片",
    "tuijian": "商品的推荐奖励",
    "superfuwu": "上级服务人奖励",
    "fuwu": "服务人奖励"
}
//举报
var reportKey = {
    "type": "举报类型",
    "count": "举报内容",
    "image": "举报图片"
}
//代理用户管理
var userKey = {
    
    "name": "名称",
    "phone": "手机",
    "password": "密码",
    "phonemi": "电话加密",
    "photo": "照片",
    "codes": "自己的邀请码",
    "superCodes": "上级的邀请码",
    "frozen": "冻结(1冻结2正常)",
    "regdate": "注册时间",
    "agentStatus": "代理状态",
    "address": "地址",
    "token": "token",
    "logintime": "登录时间"
}

var TextKey = [
    // 产品text表单
    "expressname",

    "Price",
    "img",
    "goodName",
    "adminid",
    "zd",
    "jz",
    "cat",
    "yz",
    "tg",
    "miaoshu",
    "chengfen",
    "syff",
    "dailiimage",
    "tuijian",
    "superfuwu",
    "fuwu"


];
var CheckboxKey = [
    // 产品radio表单

];
var FileKey = [
    //产品file表单

]